{% extends 'base.html' %}

{% block title %}注册{% endblock %}

{% block content %}
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card shadow">
                <div class="card-body p-5">
                    <h2 class="text-center mb-4">注册账号</h2>
                    <form action="{{ url_for('register') }}" method="post">
                        <div class="mb-3">
                            <label for="username" class="form-label">用户名</label>
                            <input type="text" class="form-control" id="username" name="username" required>
                        </div>
                        <div class="mb-3">
                            <label for="email" class="form-label">电子邮箱</label>
                            <input type="email" class="form-control" id="email" name="email" required>
                        </div>
                        <div class="mb-3">
                            <label for="password" class="form-label">密码</label>
                            <input type="password" class="form-control" id="password" name="password" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">角色</label>
                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="role" id="roleStudent" value="student" checked>
                                <label class="form-check-label" for="roleStudent">
                                    学生
                                </label>
                            </div>
                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="role" id="roleTeacher" value="teacher">
                                <label class="form-check-label" for="roleTeacher">
                                    教师
                                </label>
                            </div>
                        </div>
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary btn-lg">注册</button>
                        </div>
                    </form>
                    <div class="text-center mt-3">
                        <p>已有账号？ <a href="{{ url_for('login') }}">立即登录</a></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 